package BinaryTree;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 姚东名
 * Date: 2024-09-08
 * Time: 10:08
 */
public class Test {
    public static void main2(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        MyBinaryTree.TreeNode root = myBinaryTree.createTree();
        int sz = myBinaryTree.size2(root);
        System.out.println("树中节点的个数: " + sz);

        int val = myBinaryTree.getLeafNodeCount(root);
        System.out.println("叶子节点的个数: " + val);

        myBinaryTree.getLeafNodeCount2(root);
        System.out.println("叶子节点的个数: " + MyBinaryTree.leafSize);

        int val2 = myBinaryTree.getHeight(root);
        System.out.println("二叉树的高度: " + val2);

    }
    public static void main(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        MyBinaryTree.TreeNode root = myBinaryTree.createTree();
        System.out.println("======前序======");
        myBinaryTree.preOrder(root);
        System.out.println();
        myBinaryTree.preOrderNor(root);
        System.out.println();

        System.out.println("======中序======");
        myBinaryTree.inOrder(root);
        System.out.println();

        System.out.println("======后序======");
        myBinaryTree.postOrder(root);
        System.out.println();

        System.out.println("======层序======");
        myBinaryTree.levelOrder(root);
        System.out.println();



    }
}
